<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: appHeader"></head>
<style>
    .weui-form-preview:after {
        bottom: 0;
        border-bottom: 0px solid transparent!important;
        -webkit-transform-origin: 0 100%;
        transform-origin: 0 100%;
        -webkit-transform: scaleY(.5);
        transform: scaleY(.5)
    }
</style>
<body id="history-body" ontouchstart>
<div class="weui-form-preview">
    <div class="weui-form-preview__hd">
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">生产令号</label>
            <b class="weui-form-preview__item" th:text="${tran.prodNo}"></b>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">图号</label>
            <b class="weui-form-preview__item" th:text="${tran.drawNo}"></b>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">零件名称</label>
            <b class="weui-form-preview__item" th:text="${tran.drawName}"></b>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">零件数量</label>
            <b class="weui-form-preview__item" th:text="${tran.drawNum}"></b>
        </div>
    </div>
    <h2 th:if="${content != null}" style="margin-top: 16px;text-align: center" th:text="${content}"></h2>
<!--    <h2 th:if="${content == null and  #lists.isEmpty(list)} and ${#lists.isEmpty(completeList)}" style="margin-top: 16px;text-align: center">查无记录</h2>-->
<!--    <h2 th:if="${content == null and #lists.isEmpty(list)} and ${completeList.size() > 0}" style="margin-top: 16px;text-align: center">该零件已全部转序</h2>-->
    <div th:if="${content  == null or content  == '' }">
        <form  style="border-width: 0">
            <input type="hidden" name="id" th:value="${tran.id}">
<!--            <input type="hidden" name="routeId" th:value="${r.routeId}">-->
            <div class="weui-form-preview__bd">
                <div class="weui-form-preview__item">
                    <label class="weui-form-preview__label">转序类型</label>
                    <a class="weui-form-preview__item" th:if="${tran.type == 1}">制作件</a>
                    <a class="weui-form-preview__item" th:if="${tran.type == 2}">装配件</a>
                    <a class="weui-form-preview__item" th:if="${tran.type == 3}">返修票</a>
                </div>
                <div class="weui-form-preview__item">
                    <label class="weui-form-preview__label">工艺路线</label>
                    <b class="weui-form-preview__item" th:text="${tran.route}+'    '+${tran.orderNo}"></b>
                </div>
                <div class="weui-form-preview__item" th:if="${tran.transMode == 2}">
                    <label class="weui-form-preview__label">工艺工序</label>
                    <b class="weui-form-preview__item" th:text="${tran.process}+'    '+${tran.handNo}"></b>
                </div>
                <div class="weui-form-preview__item">
                    <label class="weui-form-preview__label">数量</label>
                    <b class="weui-form-preview__item" th:text="${tran.num}"></b>
                </div>
            </div>
            <div class="weui-form-preview__ft" style="padding-top:20px;">
                <a href="javascript:void(0);" class="weui-btn weui-btn_mini weui-btn_primary btn-rec">转序接收</a>
                <a href="javascript:void(0);" class="weui-btn weui-btn_mini weui-btn_primary btn-wait" style="display: none">请稍等</a>
            </div>
        </form>
    </div>
</div>
<div class="weui-tabbar" >
    <a th:href="@{/index}" class="weui-tabbar__item weui-bar__item--on">
        <div class="weui-tabbar__icon">
            <img th:src="@{/img/me.png}" alt="">
        </div>
        <p class="weui-tabbar__label">我的信息</p>
    </a>
    <!--生产历史-->
    <a th:if="${#strings.contains(session.user.roles,'【申请质检】')}" th:href="@{/hisApply/null/null}" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img th:src="@{/img/his_apply.png}" alt="">
        </div>
        <p class="weui-tabbar__label">历史申请</p>
    </a>
    <a th:if="${#strings.contains(session.user.roles,'【转序接收】')}" th:href="@{/hisRec/null/null}" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img th:src="@{/img/his_rec.png}" alt="">
        </div>
        <p class="weui-tabbar__label">历史接收</p>
    </a>
    <a th:if="${#strings.contains(session.user.roles,'【转序质检】')}" th:href="@{/hisCheck/null/null}" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img th:src="@{/img/his_check.png}" alt="">
        </div>
        <p class="weui-tabbar__label">历史质检</p>
    </a>
    <a th:if="${#strings.contains(session.user.roles,'【入库质检】')}" onclick="tips()" href="javascript:void(0)" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img th:src="@{/img/his_check.png}" alt="">
        </div>
        <p class="weui-tabbar__label">入库历史质检</p>
    </a>
</div>
<a id="jumpPage" style="display: none" th:href="@{/index}"/>
<div th:include="include :: appFooter"></div>
<script th:inline="javascript">

    $(function () {
        $('.btn-rec').click(function (e) {
            $('.btn-rec').hide();
            $(".btn-wait").show();
            let $form = $(e.currentTarget).parents("form");
            $.operate.submit({
                url: ctx + 'rec',
                data: new FormData($form[0]),
                fun: function () {
                    document.getElementById("jumpPage").click();//模拟点击
                }
            });
        })
    })

</script>
</body>
</html>